import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';

import { Meteor } from 'meteor/meteor';

class DeviceLogsCollection extends Mongo.Collection {
    update(selector, modifier) {
        const result = super.update(selector, modifier);
        return result;
    }
    insert(log, callback) {
        const ourDeviceLogs = log;
        const result = super.insert(ourDeviceLogs, callback);
        return result;
    }
    remove(selector, callback) {
        const result = super.remove(selector, callback);
        return result;
    }
}

export const DeviceLogs = new DeviceLogsCollection('device_logs');

DeviceLogs.deny({
    insert() { return true; },
    update() { return true; },
    remove() { return true; },
});

DeviceLogs.schema = new SimpleSchema({

    openName:{
        label:"开锁操作用户名",
            type:String
    },
    openTime:{
        label:"开锁时间",
            type:Date
    },
    openType:{
        label:"开锁类型",
            type:String
    },
    deviceId:{
        label:"锁ID",
            type:String
    }

});
DeviceLogs.attachSchema(DeviceLogs.schema);
